//
//  main.cpp
//  LuaP
//
//  Created by liyong on 2016/10/18.
//  Copyright © 2016年 liyong. All rights reserved.
//

#include <iostream>


#include "LuaP.hpp"

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    auto ll = luaL_newstate();
    luaopen_luaProfiler(ll);
    
    luaL_dostring(ll, "luaProfiler.setLogPath(\"test.log\")");
    luaL_dostring(ll, "luaProfiler.start()");
    luaL_dostring(ll, "function aa(a) return a+1 end\n local b = aa(1)\n");
    luaL_dostring(ll, "luaProfiler.writeLog()");
    luaL_dostring(ll, "luaProfiler.stop()");

    return 0;
}
